<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>报价单</title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script>
   //检索 
   function searchListForm() {
		var styleNo = $("#styleNo").val();
		var ognizationName = $("#ognizationName").val();
		var styleCateGoryCd = $("#styleCateGoryCd").val();
		var dateFrom = $("#dateFrom").val();
		var dateTo = $("#dateTo").val();
		var userId = $("#userId").val();
		$("#activity_pane").showLoading();
		$.post("${ctx}/bigcargo/style/searchList?styleNo=" + styleNo + "&ognizationName=" + ognizationName
				+ "&styleCateGoryCd=" + styleCateGoryCd + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&otherImageFlg=fashStyleSelRef", "",
				function(result) {
					var listHtml = result["bigcargoStyle"];
					var pageHtml = result["page"];
					$("#listHtml").html(listHtml);
					$("#paging").html(pageHtml);
					$("#activity_pane").hideLoading();
				}, 'json');
	}
        
	 //重置
	function clean() {
		if ($("#frameFlg").val()!=3){
			$("input.customer").val("");
		}
		$("input.input").val("");
		$("select").val("");
		searchListForm();
	}    
    function selectStyle() {
    	//获取 iframe 数量 
    	var frLength = window.parent.frames.length;
    	//父画面下标 
    	var parentIndex = frLength-2;
    	var customerStyleNo = $("#listHtml tr.trSelected").find(".customerStyleNo").val();
		var styleNameCn = $("#listHtml tr.trSelected").find(".styleNameCn").val();
		var styleColor = $("#listHtml tr.trSelected").find(".styleColor").val();
		var styleYear = $("#listHtml tr.trSelected").find(".styleYear").val();
		var refStyleNo = $("#listHtml tr.trSelected").find(".refStyleNo").val();
		var styleRemark = $("#listHtml tr.trSelected").find(".styleRemark").val();
		var styleTempSeason = $("#listHtml tr.trSelected").find(".styleTempSeason").val();
		var styleStyleGroupCd = $("#listHtml tr.trSelected").find(".styleStyleGroupCd").val();
		var styleTemp = $("#listHtml tr.trSelected").find(".styleTemp").val();
		var styleOgnizaitonTemp = $("#listHtml tr.trSelected").find(".styleOgnizaitonTemp").val();
		var uploadFile = $("#listHtml tr.trSelected").find(".uploadFile").val();
		var styleID = $("#listHtml tr.trSelected").find(".styleID").val();
		var ognizationId = $("#listHtml tr.trSelected").find(".ognizationId").val();
		var brandId = $("#listHtml tr.trSelected").find(".brandId").val();
		var selectCode = styleTemp.split("-");
		var url = "?styleID="+styleID+"&customerStyleNo="+customerStyleNo+"&styleNameCn="+styleNameCn
				+"&styleColor="+styleColor+"&styleYear="+styleYear+"&styleStyleGroupCd="+styleStyleGroupCd
				+"&styleTemp="+styleTemp+"&styleOgnizaitonTemp="+styleOgnizaitonTemp+"&styleRemark="+styleRemark
				+"&uploadFile="+uploadFile+"&styleTempSeason="+styleTempSeason+"&bigcargoCustomer="+ognizationId
				+"&brandId="+brandId+"&popupCategoryCd="+(selectCode[1]+"_FIT_ITEM");
        window.parent.frames[parentIndex].callBackStyleInfo(url,styleID,customerStyleNo);
    	closeWin();
	}
    //选择按钮事件
    function selectFunction(obj){
    	$("#listHtml tr").removeClass('trSelected');
    	$(obj).addClass('trSelected');
    	
    }
    </script>
    
</head>
<body style="min-width: 870px">
<form id="searchForm">
<input type = "hidden" id = "frameFlg" value="${quotation.frameFlg}"/>
<div class="layerHeader clearfix" style="width: 900px">
	<p class="headerTitle"><spring:message code="quotation_style_selectStyle" /></p>
	<div class="headerButton clearfix">
                <button type="button" onclick="searchListForm();"><spring:message code="quotation_style_search" /></button>
                <button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
                <button type="button" onclick="selectStyle();"><spring:message code="quotation_style_selected" /></button>
                <button type="button" onclick="closeWin();"><spring:message code="quotation_style_cancle" /></button>
                </div>
</div>
<div class="listArea" style="width: 900px" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
            <div id="showHtml" class=" clearfix">
					<div class="searchInp clearfix">
						<!-- 款号 -->
						<p style="width: 60px;">
							<spring:message code="bigcargo_model_no" />
						</p>
						<input class="w-styleNub" id="styleNo" name="styleNo">
					</div>
					<div class="searchInp clearfix">
						<!-- 客户 -->
						<p style="width: 60px;">
							<spring:message code="bigcargo_customer" />
						</p>
						<input class="w-customer" id="ognizationName"
							name="ognizationName">
					</div>
					<div class="searchInp clearfix">
						<!-- 款式类别 -->
						<p style="width: 60px;">
							<spring:message code="bigcargo_style_model" />
						</p>
						<select class="w-styleCategory" id="styleCateGoryCd"
							name="styleCateGoryCd" style="width: 120px">
							<option value=""><spring:message
									code="order_please_choose" /></option>
							<c:forEach items="${styleList}" var="item">
								<option value="${item.itemCode}-${item.itemValue}">${item.itemName}</option>
							</c:forEach>
						</select>
					</div>
					<div class="searchInp clearfix">
						<!-- 日期 -->
						<p style="width: 60px;">
							<spring:message code="bigcargo_date" />
						</p>
						<div class="timeBox">
							<input type="text" onblur="CheckDate(this);" 
								id="dateFrom" name="dateFrom" style="width: 100px">
							<p class="list">~</p>
							<input type="text" id="dateTo" name="dateTo"
								style="width: 100px" onblur="CheckDate(this);" >
						</div>
					</div>
				</div>
                
        </div>
   
        <div class="tableArea tabBoxSm" >
            <div class="tableScroll tabSm" style="overflow: auto;height: 420px;width:860px">
                <table cellpadding="0" class="tableHead " >
                    <thead>
                    <tr>
                        <!-- No. -->
								<th><p class="table-No">
										<spring:message code="common_no" />
									</p></th>
								<!-- 款式图片 -->
								<th><p class="width-80px">
										<spring:message code="bigcargo_style_stylePictures" />
									</p></th>
								<!-- 款号/款式名称 -->
								<th><p class="width-150px">
										<spring:message code="bigcargo_no_name" />
									</p></th>
								<!-- 款式类别 -->
								<th><p class="width-100px">
										<spring:message code="bigcargo_styleCategory" />
									</p></th>
								<!-- 年份季节 -->
								<th><p class="width-100px">
										<spring:message code="bigcargo_style_yearAndSeason" />
									</p></th>
								<!-- 客户 -->
								<th><p class="width-150px">
										<spring:message code="bigcargo_customerName" />
									</p></th>
								<!-- 创建者 -->
								<th><p class="width-100px">
										<spring:message code="bigcargo_creater" />
									</p></th>
								<!-- 创建日期 -->
								<th><p class="width-100px">
										<spring:message code="bigcargo_create_date" />
									</p></th>
							</tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody" >              
                    <tbody id = "listHtml">
                    
                    </tbody>
                </table>
            </div>
            
        </div>
    </div>
    <div id = "paging" ></div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function(){
	$("#styleCateGoryCd").select2();
	searchListForm();
});
</script> 
</body>
</html>
	